package com.tacorpus.ui.wizards;

import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;

public class TacorpusProjectWizardPage extends WizardPage {

	private Combo translationCombo;
	private static final String[] comboLabels = {"英語⇒日本語", "日本語⇒英語"};

	public TacorpusProjectWizardPage() {
		super("New Tacorpus Project Wizard Page");
		setTitle("New Tacorpus Project Wizard Page");
		setDescription("New Tacorpus Project Wizard Page");
	}

	public void createControl(Composite parent) {
		Composite container = new Composite(parent, SWT.NULL);
		GridLayout layout = new GridLayout();
		container.setLayout(layout);
		layout.numColumns = 3;
		layout.verticalSpacing = 9;
		Label label = new Label(container, SWT.NULL);
		label.setText("翻訳:");

		translationCombo = new Combo(container, SWT.BORDER | SWT.READ_ONLY);
		GridData gd = new GridData(GridData.FILL_HORIZONTAL);
		translationCombo.setLayoutData(gd);
		for(String comboLabel : comboLabels) {
			translationCombo.add(comboLabel);
		}
		translationCombo.select(0);
		setControl(container);

	}
	
	public int getTranslationComboSelectionIndex() {
		return translationCombo.getSelectionIndex();
	}
	
	public String getTranslationComboSelectionLabel() {
		return comboLabels[getTranslationComboSelectionIndex()];
	}

	@Override
	public boolean isPageComplete() {
		return isCurrentPage();
	}

}
